{% form_theme searchForm myBundleName ~ ':Layout:fields.html.twig' %}

{% extends myBundleName ~ ':Layout:layout.html.twig' %}

{% block title %}{{ myTitlePrefix }} Person Search {% endblock %}

{% block content %}
<form method="post" action="{{ path('zayso_core_admin_person_search') }}" {{ form_enctype(searchForm) }}>
<table border="1" class="form_table" width="750">
    <tr>
        <td>Last Name</td>
        <td>First Name</td>
        <td>Nick Name</td>
        <td>AYSOID</td>
        <td>Region</td>
    </tr>
    <tr>
        <td>{{ form_widget(searchForm.lastName) }}</td>
        <td>{{ form_widget(searchForm.firstName)}}</td>
        <td>{{ form_widget(searchForm.nickName) }}</td>
        <td>{{ form_widget(searchForm.aysoid)   }}</td>
        <td>{{ form_widget(searchForm.region)   }}</td>
    </tr>
    <tr>
        <td colspan="8" align="right"><input type="submit" name="personSearchSubmit" value="Search" /></td>
    </tr>
</table>
{{ form_rest(searchForm) }}        
</form>
<table border="1" width="750">
    <tr>
        <td>ID</td>
        <td>Last Name</td>
        <td>First Name</td>
        <td>Nick Name</td>
        <td>AYSOID</td>
        <td>Region</td>
    </tr>
    {% for person in persons %}
    <tr id="person-list-{{person.id}}">
        <td><a href="{{ path('zayso_core_admin_person_edit', { 'personId': person.id }) }}">{{ person.id }}</a></td>
        <td>{{ person.lastName  }}</td>
        <td>{{ person.firstName }}</td>
        <td>{{ person.nickName  }}</td>
        <td>{{ person.regAYSOV.aysoid }}</td>
        <td>{{ person.regAYSOV.region }}</td>    
    </tr>
    {% endfor %}
</table>

{% endblock %}
